
			<script type="text/javascript">
function save() {
			var datas = $O('tree1').getSelectedDatas();
			if (datas.length == 0){
            alert('${message('J_BELONGTO_DEPT')}');
				return;
			}
			
            
				var ids = [];
                var idnames = [];
                var idcodes = [];
                

				for (var i=0; i<datas.length; i++)
				{
					ids[i] = datas[i].id;
					idnames[i] = datas[i].label;
					idcodes[i] = datas[i].code;
					
				}
				var areaids = ids.join(",");
				var areanames = idnames.join(",");
				var areacodes = idcodes.join(",");
				
			    opener.setAreas(areaids,areanames,areacodes);
				window.close();
			
		}			
</script>

			<div caption="label.L_BelongToDept" id="UyDb" skin="blue" class="panel_blue">
				<div class="panel_head_blue">
					<img src="${IMAGE_ROOT?default(".")}/quote.gif" />
					${(label.L_BelongToDept + label.L_Colon)?default("")}
				</div>
				<div class="panel_body_blue" >
					
			<div id="tree1" nodeGrade="grade" nodeId="id" parentNodeId="parentid"></div>
			<script type="text/javascript">
				(function(o){
					new Opal.DCMS3.MultiSelectedTree(o);
				})({
					id: 'tree1',
			nodeGrade: 'grade',
			nodeId: 'id',
			parentNodeId: 'parentid',
					binding: {
						value: 'department',
						selectedIds: 'selectedids'
					}
				});
			</script>
		

			<#assign privilegeCodes = ["undefinedValue"]>
			<#assign privileges = privileges?default([])>
			<#assign hasPrivilege = false>
			<#if privilegeCodes?first = "undefinedValue">
				<#assign hasPrivilege = true>
			</#if>
			<#list privileges as privilege>
				<#list privilegeCodes as code>
					<#if privilege = code>
						<#assign hasPrivilege = true>
						<#break>
					</#if>
				</#list>
				<#if hasPrivilege = true>
					<#break>
				</#if>
			</#list>
			<#if hasPrivilege>
				<input type="button" class="button1" id="iQLK" value="${(label.L_Confirm)?default("")}" />
				<script type="text/javascript">
				
					(function(o){
						new Opal.Core.Button(o);
						Opal.Util.registerEventListener($O('iQLK'), 'click', save);
					})({
						id: 'iQLK',
						binding: {
							value: 'label.L_Confirm'
						}
					});
					
				</script>
			</#if>
		
				</div>
			</div>
		
		